package BookManage;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class deleteBook {
    public static void main(String[] args) {
        Connection connection=null;
        PreparedStatement statement=null;
        ResultSet resultSet=null;
        try {
            connection=operation.My_Get_Connection();
            String sql="delete from borrow_info where id=(select t.id from(select max(id) id from borrow_info)r)";
            statement=connection.prepareStatement(sql);
            int ret=statement.executeUpdate();
            System.out.println(ret);
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            operation.My_close(connection,statement,resultSet);
        }
    }
}
